/*
 * @author wilbur.ma@qq.com
 * @date 2011.06.01
 */
 function cond_show_all() {
	if ($("#filter_input").val() == "")
		show_all($(".result_form"));
 }
 
 function cond_fold_all() {
	if ($("#filter_input").val() == "")
		fold_all($(".result_form"));
 }
 
 window.onload = function(event) {
	$("#showall").click(function(event) { cond_show_all(); });
	$("#hideall").click(function(event) { cond_fold_all(); });
	$("#filter_input").focus(function() { $("#filter_input").val(""); fold_all($(".result_form"));});
	$("#filter_input").quicksearch(".result_form", {
				"selector": ".state_span",
				"bind": "keyup click"
				}
			);
	$(".form_state").each(function() {
		$(this).click(function(event) { 
			fold_all_except($(".result_form"), $(this).parent());
		})
	});
	cond_fold_all();
 }